\section{network::generic\_\-queue$<$ T $>$ Class Template Reference}
\label{classnetwork_1_1generic__queue}\index{network::generic_queue@{network::generic\_\-queue}}
This class provides a generic synchronized queue.  


{\tt \#include $<$generic\_\-queue.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\bf{generic\_\-queue} ()\label{classnetwork_1_1generic__queue_ab4dfaa74d3219cb282cf8b29d84037a}

\item 
void \bf{put} (boost::shared\_\-ptr$<$ T $>$ obj)
\begin{CompactList}\small\item\em put inserts a object in the queue. \item\end{CompactList}\item 
boost::shared\_\-ptr$<$ T $>$ \bf{get} ()
\begin{CompactList}\small\item\em get returns a object, you previousely inserted into the queue. If there are no objects in the queue, your thread is put into the sleep-state. The returned object is of course removed from the queue. \item\end{CompactList}\item 
void \bf{interrupt} ()\label{classnetwork_1_1generic__queue_30c99563043e88dc78f05676782ece46}

\begin{CompactList}\small\item\em interrupt wakes all threads up, and throws a runtime\_\-error-exception to exit all threads. \item\end{CompactList}\item 
bool \bf{is\_\-interrupt} () const 
\begin{CompactList}\small\item\em is\_\-interrupt returnes if the queue was interrupted. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$ class network::generic\_\-queue$<$ T $>$}

This class provides a generic synchronized queue. 



Definition at line 42 of file generic\_\-queue.h.

\subsection{Member Function Documentation}
\index{network::generic_queue@{network::generic\_\-queue}!get@{get}}
\index{get@{get}!network::generic_queue@{network::generic\_\-queue}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ boost::shared\_\-ptr$<$T$>$ \bf{network::generic\_\-queue}$<$ T $>$::get ()\hspace{0.3cm}{\tt  [inline]}}\label{classnetwork_1_1generic__queue_6332f03844fc760461d7d6d33013a555}


get returns a object, you previousely inserted into the queue. If there are no objects in the queue, your thread is put into the sleep-state. The returned object is of course removed from the queue. 

\begin{Desc}
\item[Returns:]a shared\_\-ptr to a object you previousely inserted is returned. \end{Desc}


Definition at line 65 of file generic\_\-queue.h.

\begin{Code}\begin{verbatim}66                 {
67                         boost::mutex::scoped_lock l(_monitor);
68                         while(_list.empty()) {
69                                 _cond.wait(l);
70                                 if(_is_interrupt) {
71                                         throw std::runtime_error(
72                                                 "error, thread should exit");
73                                 }
74                         }
75                         boost::shared_ptr<T> tmp(_list.front());
76                         _list.pop_front();
77                         return tmp;
78                 }
\end{verbatim}\end{Code}


\index{network::generic_queue@{network::generic\_\-queue}!is_interrupt@{is\_\-interrupt}}
\index{is_interrupt@{is\_\-interrupt}!network::generic_queue@{network::generic\_\-queue}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ bool \bf{network::generic\_\-queue}$<$ T $>$::is\_\-interrupt () const\hspace{0.3cm}{\tt  [inline]}}\label{classnetwork_1_1generic__queue_2e09dbf4b9b7a6bfa4a169e706e548f5}


is\_\-interrupt returnes if the queue was interrupted. 

\begin{Desc}
\item[Returns:]True if the queue was interrupted, false if not. \end{Desc}


Definition at line 94 of file generic\_\-queue.h.

\begin{Code}\begin{verbatim}94                                           {
95                         return _is_interrupt;
96                 }
\end{verbatim}\end{Code}


\index{network::generic_queue@{network::generic\_\-queue}!put@{put}}
\index{put@{put}!network::generic_queue@{network::generic\_\-queue}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ void \bf{network::generic\_\-queue}$<$ T $>$::put (boost::shared\_\-ptr$<$ T $>$ {\em obj})\hspace{0.3cm}{\tt  [inline]}}\label{classnetwork_1_1generic__queue_713912a657cf12edfb64ed856d99fc3c}


put inserts a object in the queue. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em obj}]is a shared\_\-ptr to the object, you want to insert. \end{description}
\end{Desc}


Definition at line 50 of file generic\_\-queue.h.

\begin{Code}\begin{verbatim}51                 {
52                         boost::mutex::scoped_lock l(_monitor);
53                         _list.push_back(obj);
54                         _cond.notify_one();
55                 }
\end{verbatim}\end{Code}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
network/generic\_\-queue.h\end{CompactItemize}
